<?php
/**
 * Created by PhpStorm.
 * User: zhouyao
 * Date: 2017/10/10
 * Time: 下午3:28
 */
namespace App\Http\Controllers;

use HuangYi\Rbac\Managers\PermissionManager;

class PermissionController extends Controller
{
    protected $permissionManager;

    public function __construct(PermissionManager $permissionManager)
    {
        $this->permissionManager = $permissionManager;
    }

    public function index()
    {

    }

    public function store()
    {
        $permission = $this->permissionManager->create([
            'name' => '创建产品',
            'slug' => 'product.create',
            'description' => '控制创建产品权限访问'
        ]);
        dd($permission);
    }

    public function destroy($id)
    {
        $deleted = $this->permissionManager->delete($id);
    }
}